#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    Point(int x = 0, int y = 0)
    : _ix(x)
    , _iy(y)
    { cout << "Point(int,int)" << endl; }

    void print() const{
        cout << "(" << _ix
            << "," << _iy
            << ")" << endl;
    }
protected:
    int _ix;
private:
    int _iy;
};

class Point3D
: protected Point//保护继承
{
public:
    Point3D(int x, int y, int z)
    : Point(x,y)
    , _iz(z)
    {
        cout << "Point3D(int*3)" << endl;
    }

    //添加了新的成员函数
    void display() const{
       	print();
        cout << _ix << endl;
        /* cout << _iy << endl; */
        cout << _iz << endl;
    }
private:
    //添加新的数据成员
    int _iz;
};

void test0(){
    Point3D pt3d(1,2,3);
    /* pt3d.print(); */
    pt3d.display();
    /* pt3d._ix; */
    /* pt3d._iy; */

    Point pt(7,8);
    /* pt._ix; */
}

int main(void){
    test0();
    return 0;
}
